<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件</title>
</head>
<body>
    <div id="app">
        <ul>
            <show-item v-for="res in show" :Linbao="res"></show-item>
        </ul>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script>
        Vue.component("show-item",{
            // 对应前端 v-bind: x 动态变量名
            props:['Linbao'],
            template: `<li>
                {{ Linbao.name }}
            </li>`
        });
        let app = new Vue({
            el: '#app',
            data(){
                return {
                    show: [
                        {
                            name: '针不戳'
                        },
                        {
                            name: '我戳'
                        },
                        {
                            name: '妙哉'
                        }
                    ]
                }
            }
        })
    </script>
</body>
</html>